/*

Wavefront OBJ

*/

#ifndef OBJMTL_H
#define OBJMTL_H

#include "marray.h"

#pragma pack(1)

typedef struct {
	float f[8];
} Vec8f;

typedef struct {
	float f[3];
} Vec3f;

typedef struct {
	float f[2];
} Vec2f;

typedef struct {
	int d[3];
} Inds;

typedef struct {
  MArray* hvs;
	MArray* hvns;
	MArray* hvts;
	MArray* hinds;
	MArray* fs;
} OBJFILE;

#pragma pop

void freeOBJFILE(OBJFILE* hobj);
void makeVBOVert(OBJFILE* hobj, int iv, int ivt, int ivn, Vec8f* hvvbo);
MArray* makeVBO(OBJFILE* hobj);
OBJFILE* readOBJFILE(char* fname);


#endif
